
import React, { Component } from 'react'

interface IProps{
  name:string,
  age:number,
  sex?:string
}

interface IState{
  color:string
}


export default class Home extends Component<IProps,IState> {

  constructor(props:IProps){
    super(props);
    this.state = {
      color:"red"
    }
  }

  eat(str:string):number{
    return 12;
  }

  render() {
    return (
      <>
      <div>Home</div>
      <p>this.props.name:{this.props.name}</p>
      <p>this.props.age:{this.props.age}</p>
      <p style={{color:this.state.color}}>this.props.sex:{this.props.sex}</p>     
      </>
    )
  }
}
